--代表有X个Logo 分别为logo1.png-logoX.png
GLOGO = 1



local scene = nil
local layer = nil

function runGameLogo()
    scene = CCScene:create()
    layer = CCLayerColor:create(ccc4(255,255,255,255))
    scene:addChild(layer)
    
    -- 当前加载的logo索引
    local logoIndex = 1
    
    local showlogoSp = nil
    local showNextLogo = nil
    local isendsdd = false
    showNextLogo = function()
        if showlogoSp ~= nil then
            layer:removeChild(showlogoSp, true)
            showlogoSp = nil
        end
        
        if isendsdd then
            return
        end
        
        if logoIndex > GLOGO then
            scene, uiid = createLoading()
            ShowSceneLayer = scene
            CCDirector:sharedDirector():replaceScene(scene)
            
            isendsdd = true
            return
        end
        
        showlogoSp = CCSprite:create(string.format("logo/logo%d.png",logoIndex))
        showlogoSp:setPosition(ccp(DWinSize.width/2, DWinSize.height/2))
        showlogoSp:setScale(1.5*DeviceScale)
        layer:addChild(showlogoSp)
        
        logoIndex = logoIndex + 1
        
        local array = CCArray:create()
        array:addObject(CCFadeIn:create(0.5))
        array:addObject(CCFadeTo:create(2.0, 255))
        array:addObject(CCFadeOut:create(0.5))
        showlogoSp:runAction(CCSequence:createWithTwoActions(CCSequence:create(array), CCCallFuncN:create(function()
            --显示下一个
            showNextLogo()
        end)))
    end
    
    local logoshowEnd = function()
    
    end
    
    -- 触摸回调响应
    local function onTouch(eventType, x, y)
        --logoshowEnd()
        showNextLogo()
    end
    -- 接受触摸
    layer:setTouchEnabled(true)
    layer:registerScriptTouchHandler(onTouch)

    showNextLogo()

    return scene, 0x99
end














